<template>
	<view>
		<!-- 标题图片 -->
		<!-- <view class="guess" @click="jump('')">
			<image class="image"
				src="https://ceshi.senmainet.com/web/uploads/mall1/20210507/7423cce3d922874c39fd79edd8ec2fcb.png"
				mode=""></image>
		</view> -->
		<view class='guess' v-if="pageList[195]" @click="jump(pageList[195].url,pageList[195].params.content)">
			<image :src="pageList[195].icon_url" class="image" />
		</view>
		<!-- 文章文字 -->
		<view class='article' v-if="pageList[196]" @click="jump(pageList[196].url,pageList[195].params.content)">
			{{pageList[196].params.content}}
		</view>
		<!-- <view class="article">
			文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容
		</view> -->
		<view class="litifree">
			<video id="myVideo" :show-fullscreen-btn="false" class="video-cover" :src="pageList[197].icon_url" :poster="pageList[197].icon_url" controls></video>
			<view class="freeword">
				<text>{{pageList[197].name}}</text>
			</view>
		</view>
		<!-- <view class='litifree' v-if="pageList[193]" @click="jump(pageList[193].url,pageList[195].params.content)">
			<video id="myVideo" :show-fullscreen-btn="false" class="video-cover"
				src="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"
				controls></video>
			<view class="freeword">
				<text>限时免费</text>
			</view>
		</view> -->
		<!-- <view class="erweima">
			<image src="https://ceshi.senmainet.com/web/uploads/mall1/20210426/d140db35f691050c7cacbf045c6590fb.png" class="image" mode=""></image>
			<view class="downapp">
				下载APP领更多福利
			</view>
		</view> -->
		<view class='erweima' v-if="pageList[198]" @click="jump(pageList[198].url,pageList[195].params.content)">
			<image :src="pageList[198].icon_url" class="image" />
			<view class="downapp">
				{{pageList[198].name}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageList: [],
				appmsg:''
			}
		},
		onLoad() {
			this.navsReq()
			this.apptitle()
			uni.showShareMenu({
				menus: ['shareAppMessage', 'shareTimeline']
			})
		},
		onShareAppMessage() {
			return this.$shareAppMessage({
				title:'课程',
				path: '/pages/port/university/university',
				params: {
		
				}
			});
		},
		onShareTimeline() {
			return this.$shareTimeline({
				title:'课程',
				query: {
		
				}
			});
		},
		methods: {
			apptitle(){
				this.$request({
					url: this.$api.article.detail,
					data: {
						article_id: 2
					}
				}).then(res=>{
					this.appmsg = res.data.article.title
				})
			},
			btclick(item) {
				uni.showModal({
					content: this.appmsg || 'APP暂未上线，敬请期待...',
					showCancel: false,
					confirmText: '我知道了'
				})
			},
			jump(item) {
				if (item == 'javascript:;' || item == '/') {
					uni.showModal({
						content: this.appmsg || 'APP暂未上线，敬请期待...',
						showCancel: false,
						confirmText: '我知道了'
					})
					return;
				}
				if (item == '/pages/index/index' || item.indexOf('/pages/gospeed/index') != -1 || item == '/pages/sixty/index' ||
					item == '/pages/user-center/user-center' || item == '/pages/store/mine/mine') {
					uni.reLaunch({
						url: item
					})
					return;
				}
				uni.navigateTo({
					url: item
				})
			},
			navsReq() {
				this.$showLoading();
				this.$request({
					url: this.$api.navs.index,
					data: {
						id: 98
					}
				}).then((res) => {
					this.$hideLoading();
					if (res.code === 0) {
						this.pageList = res.data.list
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}
				}).catch(() => {
					this.$hideLoading();
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	// 猜你喜欢
	.guess {
		width: 686rpx;
		margin: 32rpx;
		// height: 398rpx;
		height: 280rpx;
		background-color: #FFFFFF;
		color: #333333;
		border-radius: 20rpx;

		.image {
			width: 100%;
			height: 100%;
		}
	}
	// 文章文字
	.article{
		width: 686rpx;
		border-radius: 20rpx;
		padding: 48rpx;
		margin: 32rpx auto;
		background-color: #FFFFFF;
		color: #666666;
		font-size: 24rpx;
		line-height: 36rpx;
	}
	// 限时免费
	.litifree{
		width: 686rpx;
		margin: 32rpx auto;
		border-radius: 20rpx;
		overflow: hidden;
		position: relative;
		// height: 462rpx;
		.video-cover{
			width: 100%;
		}
		.freeword{
			position: absolute;
			top: 16rpx;
			left: -24rpx;
			// width: 181rpx;
			padding: 0 32rpx;
			height: 48rpx;
			background: linear-gradient(90deg, #FD6E60 0%, #FE4C4B 100%);
			border-radius: 192rpx;
			text-align: center;
			text{
				color: #FFFFFF;
				font-weight: bold;
				font-size: 24rpx;
				line-height: 48rpx;
				text-align: center;
			}
		}
	}
	// 二维码
	.erweima{
		width: 686rpx;
		height: 496rpx;
		background-color: #FFFFFF;
		border-radius: 20rpx;
		margin: 32rpx auto;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		image{
			width: 324rpx;
			height: 324rpx;
		}
		.downapp{
			font-weight: 350;
			font-size: 24rpx;
			line-height: 72rpx;
			text-align: center;
			color: #333333;
			opacity: 0.9;
		}
	}
</style>
